<template>
  <el-form
    ref="form"
    :model="model"
    :rules="rules"
    label-position="left"
    label-width="100px"
  >
    <el-form-item label="角色名称" prop="name">
      <el-input type="text" v-model="model.name"></el-input>
    </el-form-item>
    <el-form-item label="角色备注">
      <el-input type="textarea" resize="none" v-model="model.remark"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'roleForm',
  props: {
    model: {
      type: Object,
      required: true
    },
    rules: {
      type: Object,
      required: true
    }
  },
  data: () => ({}),
  methods: {
    validate() {
      let _valid
      this.$refs.form.validate(valid => {
        if (valid) _valid = valid
      })
      return _valid
    },
    reset() {
      this.$refs.form.resetFields()
    }
  }
}
</script>
